/**
 * @ClassName BioRemovalReportController
 * @Description TODO
 * @Author 沉默小吴
 * @Date 2024/12/19 9:20
 */
package com.tledu.operate.count.controller;

import com.tledu.operate.count.entity.BioRemovalReport;
import com.tledu.operate.count.entity.vo.BioRemovalReportJSON;
import com.tledu.operate.count.service.IBioRemovalReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@CrossOrigin(origins = "http://localhost")
public class BioRemovalReportController {

    @Autowired
    private IBioRemovalReportService bioRemovalReportServiceImpl;

    @GetMapping("/bio-removal-report")
    public List<BioRemovalReportJSON> getBioRemovalReport(
            @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date startDate,
            @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date endDate) {
        return bioRemovalReportServiceImpl.getBioRemovalReportByDateRange(startDate, endDate);
    }
}